<template>
	<view class="container" @click="click">
		<image :src="url" mode="widthFix"></image>
		<view class="content-box">
			<view class="content" v-html="content">
		
			</view>
			<view class="time">
				{{subHead}}
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"newCard",
		props:{
			url:{
				type:String,
				default:'',
			},
			content:{
				type:String,
				default:'这里是新闻内容，这里是新闻内容，这里是新闻内容，',
			},
			subHead:{
				type:String,
				default:'这里是副标题'
			}
		},
		data() {
			return {
				
			};
		},
		methods:{
			click(e){
				this.$emit('click',e)
			}
		}
	}
</script>

<style lang="scss">
	.container{
		margin-bottom: 24rpx;
		display: flex;
		padding: 16rpx;
		background-color: #FFFFFF;
		border-radius: 8rpx;
		image{
			width: 236rpx;
			height: 160rpx;
			margin-right: 24rpx;
			border-radius: 8rpx;
		}
		.content-box{
			flex: 1;
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			overflow:hidden;
			.content{
				overflow:hidden;
				text-overflow:ellipsis;
				display:-webkit-box;
				-webkit-box-orient:vertical;
				-webkit-line-clamp:2; 
			}
			.time{
				color: #999CA3;
				font-size: 24rpx;
				overflow:hidden;
				text-overflow:ellipsis;
				white-space: nowrap;
			}
		}
	}
</style>
